Skip to content

Add confluent endpoint list command#3268

Open
Elango Jagadeesan (ejagade) wants to merge 2 commits intomainfrom
endpoints-api-support
Open

Add confluent endpoint list command#3268
Elango Jagadeesan (ejagade) wants to merge 2 commits intomainfrom
endpoints-api-support

Conversation

@ejagade
Copy link
Member

@ejagade Elango Jagadeesan (ejagade) commented Feb 24, 2026

Release Notes

Breaking Changes

  • None

New Features

Bug Fixes

  • None

Checklist

  • I have successfully built and used a custom CLI binary, without linter issues from this PR.
  • I have clearly specified in the What section below whether this PR applies to Confluent Cloud, Confluent Platform, or both.
  • I have verified this PR in Confluent Cloud pre-prod or production environment, if applicable.
  • I have verified this PR in Confluent Platform on-premises environment, if applicable.
  • I have attached manual CLI verification results or screenshots in the Test & Review section below.
  • I have added appropriate CLI integration or unit tests for any new or updated commands and functionality.
  • I confirm that this PR introduces no breaking changes or backward compatibility issues.
  • I have indicated the potential customer impact if something goes wrong in the Blast Radius section below.
  • I have put checkmarks below confirming that the feature associated with this PR is enabled in:
    • Confluent Cloud prod
    • Confluent Cloud stag
    • Confluent Platform
    • Check this box if the feature is enabled for certain organizations only

What

Implement the confluent endpoint list command to query Confluent Cloud endpoints via the CLI. This enables users to discover and filter endpoint configurations across their environments.

Features:

  • List endpoints with --service(required) and --environment(also obtained from context) flags
  • Filter by cloud provider (AWS, GCP, AZURE)
  • Filter by region and resource ID
  • Filter by Endpoint type (--is-private)
  • Support for multiple output formats (human, json, yaml)
  • Comprehensive test coverage with 11 integration tests

Implementation details:

  • Added endpoint SDK v0.4.0 dependency
  • Created SDK client wrapper with automatic pagination
  • Implemented CLI command following existing patterns
  • Added mock API handlers and golden files for testing

All tests passing, linter clean.

Blast Radius

It's read only command for a new API. No existing customers of confluent cli will have an impact

References

Confluent Terraform provider for Endpoints resource

Test & Review

Manual Verification Document

Implement the `confluent endpoint list` command to query Confluent Cloud
endpoints via the CLI. This enables users to discover and filter endpoint
configurations across their environments.

Features:
- List endpoints with required --service and --environment flags
- Filter by cloud provider (AWS, GCP, AZURE)
- Filter by region and resource ID
- Filter by Endpoint type (--is-private)
- Support for multiple output formats (human, json, yaml)
- Comprehensive test coverage with 11 integration tests

Implementation details:
- Added endpoint SDK v0.4.0 dependency
- Created SDK client wrapper with automatic pagination
- Implemented CLI command following existing patterns
- Added mock API handlers and golden files for testing

All tests passing, linter clean.

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
Copilot AI review requested due to automatic review settings February 24, 2026 00:32
@ejagade Elango Jagadeesan (ejagade) requested a review from a team as a code owner February 24, 2026 00:32
@confluent-cla-assistant
Copy link

🎉 All Contributor License Agreements have been signed. Ready to merge.
Please push an empty commit if you would like to re-run the checks to verify CLA status for all contributors.

Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds a new Confluent Cloud CLI surface for the Endpoints API by introducing an endpoint command group and implementing confluent endpoint list, including test-server support and integration test fixtures.

Changes:

  • Introduce confluent endpoint list with filtering flags and human/json/yaml output.
  • Add a new ccloud-sdk endpoint client wrapper with pagination handling and wire it into the shared V2 client.
  • Add test-server handler/routes plus integration tests and golden fixtures for the new command.

Reviewed changes

Copilot reviewed 20 out of 21 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
internal/endpoint/command.go Adds the new top-level endpoint command group and its run requirement annotation.
internal/endpoint/command_list.go Implements endpoint list flags, API call, sorting, and output formatting.
internal/command.go Registers the new endpoint command with the root CLI.
pkg/ccloudv2/endpoint.go Adds Endpoint API client creation and a ListEndpoints wrapper with pagination.
pkg/ccloudv2/client.go Wires the Endpoint client into the shared V2 client struct and initializer.
test/test-server/endpoint_handler.go Adds mock /endpoint/v1/endpoints handler with query filtering behavior.
test/test-server/ccloudv2_router.go Routes the endpoint list path to the new test-server handler.
test/endpoint_test.go Adds integration tests for endpoint list across formats and filters.
test/fixtures/output/endpoint/*.golden Adds golden outputs for human/json/yaml and various filter combinations.
go.mod / go.sum Adds endpoint SDK dependency and updates golang.org/x/oauth2.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +26 to +30
// Optional filter flags
cmd.Flags().String("cloud", "", "Filter by cloud provider (AWS, GCP, AZURE).")
cmd.Flags().String("region", "", "Filter by region.")
cmd.Flags().Bool("is-private", false, "Filter by privacy (true for private, false for public).")
cmd.Flags().String("resource", "", "Filter by resource ID.")
Copy link

Copilot AI Feb 24, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This command defines string flags named "cloud" and "region". The CLI prerunner parses these flag names into the global context (used for Flink settings) via Context.ParseFlagsIntoContext, so running confluent endpoint list --cloud/--region will mutate the user's Flink cloud/region selection as a side effect. Consider renaming these flags (e.g., "endpoint-cloud"/"endpoint-region") or updating ParseFlagsIntoContext to only apply these flags for Flink-related commands.

Copilot uses AI. Check for mistakes.
cmd := &cobra.Command{
Use: "endpoint",
Short: "Manage Confluent Cloud endpoints.",
Annotations: map[string]string{pcmd.RunRequirement: pcmd.RequireCloudLogin},
Copy link

Copilot AI Feb 24, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The top-level endpoint command is gated by RequireCloudLogin, which allows API-key based cloud contexts. This command uses V2Client/ListEndpoints which authenticates with an OAuth access token from the context; API-key contexts generally won't have that token and the request will fail. Use RequireNonAPIKeyCloudLogin (as done by other V2 Cloud resource commands) or otherwise implement API-key auth for the Endpoint API client.

Suggested change
Annotations: map[string]string{pcmd.RunRequirement: pcmd.RequireCloudLogin},
Annotations: map[string]string{pcmd.RunRequirement: pcmd.RequireNonAPIKeyCloudLogin},

Copilot uses AI. Check for mistakes.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants